home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / CC_C / 0574.ZIP / STRLEN.ASM < prev    next >
Assembly Source File  |  1986-08-03  |  312b  |  28 lines

  1. include compiler.inc
  2.     ttl    STRLEN, 1.03, 08-03-86 clr
  3.  
  4. ;string function - computes length of string
  5.  
  6.     dseg
  7.  
  8.     cseg
  9.  
  10.     procdef    strlen, <<dest, ptr>>
  11.     pushreg
  12.  
  13.     ldptr    di,dest
  14.     xor    al,al
  15.     mov    bx,di
  16.     mov    cx,7fffh
  17.     cld
  18.     repnz    scasb
  19.     dec    di
  20.     mov    ax,di
  21.     sub    ax,bx
  22.  
  23.     pret
  24.     pend    strlen
  25.  
  26.     finish
  27.  
  28.